import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import pageTitle from '@/components/pageTitle';
import filters from "@/utils/filters";
import directive from '@/utils/directive'
import Snotify from 'vue-snotify';
import VCharts from 'v-charts';
import BaiduMap from 'vue-baidu-map'




Vue.config.productionTip = false;

import './components/common/js/jquery.form.js'

// 自定义主题
import '@/assets/css/standard/theme/index.css';
import '@/assets/css/standard/common.scss';
import '@/assets/css/custom.css';

import "@/assets/css/ali-font/iconfont.css";
import "@/assets/css/reset.scss";
import '@/assets/css/simple.css'

import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
Vue.use(Viewer)

// 面包屑导航
Vue.component('pageTitle', pageTitle);

//charts
Vue.use(VCharts)

import echarts from 'echarts'
Vue.prototype.$echarts = echarts



Vue.use(BaiduMap, {
  ak: 'rhxBDKcgqFKRiHDAQyBkU138bw5iuxb2'
})

//使用钩子函数对路由进行权限跳转
router.beforeEach((to, from, next) => {
  document.title = `${to.meta.title}`;
  const username = sessionStorage.getItem('HD5');

  if (!username && to.path !== '/login') {
    next('/login');
  }
  next();
});


//请求
import appApi from '../src/service/hd5'

Vue.prototype.$appApi = appApi;


/* element-ui */
Vue.use(ElementUI);
Vue.use(filters);
Vue.use(directive)
Vue.use(Snotify);
Vue.use(VCharts)



new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
